<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>YK Value-added System</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type="text/css" href="css/style.css">
	<link rel="stylesheet" type="text/css" href="css/admin.css" />
	<link rel="stylesheet" type="text/css" href="css/common.css" />
	<script src="js/json.js" type="text/javascript"></script>
	<script src="js/prototype.js" type="text/javascript"></script>
	<script type="text/javascript">
		function check(){
			if(document.getElementById("paper.paper_name").value==""){
				alert("纸质名称不能为空！");
				document.getElementById("paper.paper_name").focus();
				return false ;
			}
			if(document.getElementById("paper.price").value==""){
				alert("单价不能为空！");
				document.getElementById("paper.price").focus();
				return false ;
			}
			if(document.getElementById("paper.brand").value==""){
				alert("原子牌子不能为空！");
				document.getElementById("paper.brand").focus();
				return false ;
			}
			if(document.getElementById("paper.params").value==""){
				alert("参数不能为空！");
				document.getElementById("paper.params").focus();
				return false ;
			}
			var price=document.getElementById("paper.price").value;
			var reg = new RegExp("^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$");
		    if(!reg.test(price)){
				alert("单价必须为浮点型！");
				document.getElementById("paper.price").focus();
				return false ;
			}
	        return true;
		}
	</script>
  </head>
  
  <body>
<table width="95%" border="0" align="center" cellspacing="0">
  <tr>
    <td height="30"><table width="100%" border="0">
      <tr>
        <td width="30"><img src="images/location_left.gif" width="24" height="30" /></td>
        <td>
        	您当前的位置是：报价信息 -&gt;纸质-&gt;新增纸质<br>
        </td>
      </tr>
      <tr>
          <td colspan="2"><hr width="80%" align="left"></td>
		</tr>
    </table></td>
  </tr>
  <tr>
    <td><form id="form1" name="form1" method="post" action="<%=basePath%>admin/tongzhou/paper!addPaper.action" onsubmit="return check();">
      <table width="80%" border="0" cellspacing="3">
      <tr>
          <td colspan="2"><font color="red" style="font-size:12px;"></font></td>
		</tr>
        <tr>
          <td width="100" align="right">
          	<span class="style">*</span>纸质名称：
          </td>
          <td>
          	<input type="text" style="width:250px" id="paper.paper_name" name="paper.paper_name" maxlength="30" value="" style="height: 25px;"/>
          	<input type="hidden" style="width:250px" id="paper.paper_type_id" name="paper.paper_type_id" maxlength="30" value="${paper_type_id}" style="height: 25px;"/>
          </td>
        </tr>
        
        <tr>
        	<td width="100" align="right">
	          	<span class="style">*</span>单价：
	          </td>
	          <td>
	          	<input type="text" style="width:250px" id="paper.price" name="paper.price" maxlength="100" value="" style="height: 25px;"/>
	          </td>
        </tr>
        <tr>
       	  <td width="100" align="right">
          	<span class="style">*</span>单坑/双坑：
          </td>
          <td>
          		<input type="radio" name="paper.keng" id="paper.keng" value="1" checked/>单坑
		   		<input type="radio" name="paper.keng" id="paper.keng" value="2"/>双坑
          </td>
        </tr>

        <tr>
          <td style="width:100px" align="right">
          	原子牌子：
          </td>
          <td colspan="1">
          	<textarea rows="3" cols="40" id="paper.brand" name="paper.brand"></textarea>
          </td>
        </tr>
        <tr>
          <td style="width:100px" align="right">
          	参数：
          </td>
          <td colspan="1">
          	<textarea rows="3" cols="40" id="paper.params" name="paper.params"></textarea>
          </td>
        </tr>
		<tr>
          <td colspan="2"><hr width="100%" align="left"></td>
		</tr>
        <tr>
          <td align="center" colspan="1"><input type="submit" name="Submit" value="增加" class="Button" /></td>
          <td colspan="1"><input type="button" name="Submit22" value="返回" class="Button"  onclick="window.location='<%=basePath%>admin/tongzhou/paper!listPaper.action?paper_type_id=${paper_type_id}'"/></td>
        </tr>
      </table>
        </form>
    </td>
  </tr>
</table>
</body>
</html>
